﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;

public class Warning : MonoBehaviour {
    private Text text;
    private Color defaultColor;
	// Use this for initialization
	void Start () {
        text = transform.GetComponent<Text>();
        defaultColor = text.color;
        text.color = new Color(defaultColor.r, defaultColor.g, defaultColor.b, 0);
    }

    public void SetContent(string content)
    {
        text.DOKill();
        text.text = content;
        text.color = defaultColor;
        text.DOFade(0, 2);
    }
}
